package com.openatc.agent.service;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.openatc.comm.data.MessageData;
import com.openatc.core.model.RESTRet;
import com.openatc.model.model.*;

import java.util.List;

/**
 * @Classname DevService
 * @Description
 * @Date 2022/4/8 18:41
 * @Created by panleilei
 */
public interface DevService {
    RESTRet getDevs();

    StatusDetector getDetectorStatusByAgentid(String agentid);

    PhasesStatisticsVo getPhasesStatistics(String agentid, int phaseno);

    PhasesStatisticsVo getHistoryPhasesStatistics(String agentid, JsonObject jsonObject);

    void savePhasesAndInteStatistics(JsonObject feature, MessageData msg);

    MessageData processDetectorStatus(MessageData msg, String key);

    IntersectionStatisticsVo getHistoryIntersectionStatistics(String agentid, JsonObject jsonObject);

    IntersectionStatisticsVo getIntersectionStatistics(String agentid);

    List<Vehile> getIntersectionLaneParam(String data);

    /**
     * 查询路段表中是否存在和路口id重复的
     * @param agentid
     * @return
     */
    int getSectionCount(String agentid);

    List<AscsBaseModel> getDevsBySql(String sql);

    /**
     * 从相位参数中获取车道参数
     * @param agentid
     * @return
     */
    JsonArray getLaneDirection(String agentid);
}
